package com.exam.scjp5.objectives.section_1;

/**
 * All the methods in interface are implicitly public abstract.
 * All the variables are public final static
 * You can't declare static or final methods in interface.
 */
interface ExampleInterface
{
    void exampleMethod1(); // this is actually -> public abstract void exampleMethod1();   
    static void exampleMethod2(); // can't declare STATIC method here.
    final void exampleMethod3(); // can't declare FINAL method here.
    
    int EXAMPLE_VAR = 10; // this is actually -> public final static int EXAMPLE_VAR = 10;
    int EXAMPLE_VAR2; // require initialization
}

/**
 * This class will implement ExampleInterface
 */
class ExampleInterfaceImpl implements ExampleInterface
{
    // ERROR here, because of weaker access privileges, because interface methods are 'public'.   
    // So, all the methods, which will be implemented from interface, must be 'public'
    void exampleMethod1() 
    {
        // Some implementation here.
    }
    
}

/**
 * This class will implement ExampleInterface. But did not provide implementations
 * for all the methods in interface. So class must be declared using abstract
 */
class ExampleInterfaceNotImpl implements ExampleInterface // ERROR
// abstract class ExampleInterfaceNotImpl // CORRECT
{
    // Did not implement anything. so this class needs to be abstract class.
}